package mm.chenchen.modules.mh.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import mm.chenchen.utils.ObjectUtils;

@Data
@TableName("mh_decorations_info")
public class MhDecorationsInfo implements Serializable {
    private static final long serialVersionUID = 1L;


    @TableField(exist = false)
    private String mainAttrName;
    @TableField(exist = false)
    private String attachAttr1Name;
    @TableField(exist = false)
    private String attachAttr2Name;
    @TableField(exist = false)
    private String attachAttr3Name;
    @TableField(exist = false)
    private String typeName;
    @TableField(exist = false)
    private String roleName;
    @TableField(exist = false)
    private String description;
    /**
     * =========================================================
     */

    @TableId
    private Long id;
    private String name = "无";
    private Long level;
    private Long type;
    private Long roleId;
    private Long forgingLevel;
    private String status;
    private BigDecimal price;
    private BigDecimal salePrice;
    private String attrDes;

    private Integer mainAttr;
    private Integer mainAttrVale;
    private Integer attachAttr1;
    private Integer attachAttrVale1;
    private Integer attachAttr2;
    private Integer attachAttrVale2;
    private Integer attachAttr3;
    private Integer attachAttrVale3;

    public void refreshDescription() {
        StringBuffer aa = new StringBuffer();
        aa.append(mainAttrName + ":" + mainAttrVale);
        aa.append(", " + attachAttr1Name + ":" + attachAttrVale1);
        aa.append(", " + attachAttr2Name + ":" + attachAttrVale2);
        if (!ObjectUtils.isEmpty(attachAttr3Name)) {
            aa.append(", " + attachAttr3Name + ":" + attachAttrVale3);
        }
        aa.append("," + level + "级,精炼" + forgingLevel);
        if (!ObjectUtils.isEmpty(roleName)) {
            aa.append(",所属:" + roleName);
        }
        description = aa.toString();
    }
}
